<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="taglibs.jsp"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<title>气度网 - 气度如水</title>
    <link type="text/css" rel="stylesheet" href="${ctx}/css/product_list.css" >
    <script type="text/javascript">
		function changeOption(url){
			location.href = '${ctx}/my/listByUser?' + url;
		};
	</script>   
</head>

<body>
	<div class="container_list">
		<div class="title">
        	<div class="ctrl">产品信息列表</div>
            <div class="ctrl">
                        排列方式
                        <select onChange="changeOption(this.options[this.selectedIndex].value)">
                        <s:if test=" orderBy== 'create_date' & asc== 'desc' ">
                            <option value="orderBy=create_date&asc=desc" selected>发布时间最近</option>
                            <option value="orderBy=create_date&asc=asc" >发布时间最晚</option>
                            <option value="orderBy=price&asc=desc">价格从高到低</option>
                            <option value="orderBy=price&asc=asc">价格从低到高</option>                        
                            <option value="orderBy=page_views&asc=desc">人气从高到低</option>
                            <option value="orderBy=page_views&asc=asc">人气从低到高</option>
                            <option value="orderBy=prod_level&asc=desc">等级从高到低</option>
                            <option value="orderBy=prod_level&asc=asc">等级从低到高</option>                       
                        </s:if>
                        <s:elseif test=" orderBy== 'create_date' & asc=='asc' ">
                            <option value="orderBy=create_date&asc=desc" >发布时间最近</option>
                            <option value="orderBy=create_date&asc=asc" selected>发布时间最晚</option>
                            <option value="orderBy=price&asc=desc">价格从高到低</option>
                            <option value="orderBy=price&asc=asc">价格从低到高</option>                        
                            <option value="orderBy=page_views&asc=desc">人气从高到低</option>
                            <option value="orderBy=page_views&asc=asc">人气从低到高</option>
                            <option value="orderBy=prod_level&asc=desc">等级从高到低</option>
                            <option value="orderBy=prod_level&asc=asc">等级从低到高</option>                      
                        </s:elseif>
                        <s:elseif test=" orderBy== 'price' & asc=='desc' ">
                            <option value="orderBy=create_date&asc=desc" >发布时间最近</option>
                            <option value="orderBy=create_date&asc=asc">发布时间最晚</option>
                            <option value="orderBy=price&asc=desc" selected>价格从高到低</option>
                            <option value="orderBy=price&asc=asc">价格从低到高</option>                        
                            <option value="orderBy=page_views&asc=desc">人气从高到低</option>
                            <option value="orderBy=page_views&asc=asc">人气从低到高</option>
                            <option value="orderBy=prod_level&asc=desc">等级从高到低</option>
                            <option value="orderBy=prod_level&asc=asc">等级从低到高</option>                        
                        </s:elseif>
                        <s:elseif test=" orderBy== 'price' & asc=='asc' ">
                            <option value="orderBy=create_date&asc=desc" >发布时间最近</option>
                            <option value="orderBy=create_date&asc=asc">发布时间最晚</option>
                            <option value="orderBy=price&asc=desc">价格从高到低</option>
                            <option value="orderBy=price&asc=asc" selected>价格从低到高</option>                        
                            <option value="orderBy=page_views&asc=desc">人气从高到低</option>
                            <option value="orderBy=page_views&asc=asc">人气从低到高</option>
                            <option value="orderBy=prod_level&asc=desc">等级从高到低</option>
                            <option value="orderBy=prod_level&asc=asc">等级从低到高</option>                        
                        </s:elseif>
                        <s:elseif test=" orderBy=='page_views' & asc=='desc' ">
                            <option value="orderBy=create_date&asc=desc" >发布时间最近</option>
                            <option value="orderBy=create_date&asc=asc">发布时间最晚</option>
                            <option value="orderBy=price&asc=desc">价格从高到低</option>
                            <option value="orderBy=price&asc=asc">价格从低到高</option>                        
                            <option value="orderBy=page_views&asc=desc" selected>人气从高到低</option>
                            <option value="orderBy=page_views&asc=asc">人气从低到高</option>
                            <option value="orderBy=prod_level&asc=desc">等级从高到低</option>
                            <option value="orderBy=prod_level&asc=asc">等级从低到高</option>                        
                        </s:elseif>
                        <s:elseif test=" orderBy=='page_views' & asc=='asc' ">
                            <option value="orderBy=create_date&asc=desc" >发布时间最近</option>
                            <option value="orderBy=create_date&asc=asc">发布时间最晚</option>
                            <option value="orderBy=price&asc=desc">价格从高到低</option>
                            <option value="orderBy=price&asc=asc">价格从低到高</option>                        
                            <option value="orderBy=page_views&asc=desc">人气从高到低</option>
                            <option value="orderBy=page_views&asc=asc" selected>人气从低到高</option>
                            <option value="orderBy=prod_level&asc=desc">等级从高到低</option>
                            <option value="orderBy=prod_level&asc=asc">等级从低到高</option>                        
                        </s:elseif>
                        <s:elseif test=" orderBy== 'prod_level' & asc=='desc' ">
                            <option value="orderBy=create_date&asc=desc" >发布时间最近</option>
                            <option value="orderBy=create_date&asc=asc">发布时间最晚</option>
                            <option value="orderBy=price&asc=desc">价格从高到低</option>
                            <option value="orderBy=price&asc=asc">价格从低到高</option>                        
                            <option value="orderBy=page_views&asc=desc">人气从高到低</option>
                            <option value="orderBy=page_views&asc=asc">人气从低到高</option>
                            <option value="orderBy=prod_level&asc=desc" selected>等级从高到低</option>
                            <option value="orderBy=prod_level&asc=asc">等级从低到高</option>                        
                        </s:elseif>
                        <s:else>
                            <option value="orderBy=create_date&asc=desc" >发布时间最近</option>
                            <option value="orderBy=create_date&asc=asc">发布时间最晚</option>
                            <option value="orderBy=price&asc=desc">价格从高到低</option>
                            <option value="orderBy=price&asc=asc">价格从低到高</option>                        
                            <option value="orderBy=page_views&asc=desc">人气从高到低</option>
                            <option value="orderBy=page_views&asc=asc">人气从低到高</option>
                            <option value="orderBy=prod_level&asc=desc">等级从高到低</option>
                            <option value="orderBy=prod_level&asc=asc" selected>等级从低到高</option>
                        </s:else>
                        </select>
			</div>
			<div class="ctrl">
                        显示长度
                        <select onChange="changeOption(this.options[this.selectedIndex].value)">
                        <s:if test="pageSize==10">
                            <option value="pageSize=10" selected>10条</option>
                            <option value="pageSize=20">20条</option>
                            <option value="pageSize=50">50条</option>
                            <option value="pageSize=100">100条</option>
                        </s:if>
                        <s:elseif test="pageSize==20">
                            <option value="pageSize=10">10条</option>
                            <option value="pageSize=20" selected>20条</option>
                            <option value="pageSize=50">50条</option>
                            <option value="pageSize=100">100条</option>                       
                        </s:elseif>
                        <s:elseif test=" pageSize==50">
                            <option value="pageSize=10">10条</option>
                            <option value="pageSize=20" >20条</option>
                            <option value="pageSize=50" selected>50条</option>
                            <option value="pageSize=100">100条</option>                           
                        </s:elseif>
                        <s:else>
                            <option value="pageSize=10">10条</option>
                            <option value="pageSize=20" >20条</option>
                            <option value="pageSize=50" >50条</option>
                            <option value="pageSize=100" selected>100条</option>                         
                        </s:else>                            
                        </select>
			</div>
        </div> 
        <div class="detail">
        	<li class="index_list">
            	<div class="index_">序号</div>
                <div class="pro_type_">产品价格</div>
                <div class="pro_name_">产品名称</div>
                <div class="contact_">联系人</div>
                <div class="end_date_">截止日期</div>
                <div class="public_date_">发布日期</div>
                <div class="no_">维护操作</div>
            </li>
            <s:iterator value="productList.objList" var="product" status="count" >
	        	<li>
	            	<div class="index_"><s:property value="#count.index + 1"/></div>
	                <div class="pro_type_"><s:property value="#product.price" /></div>
	                <div class="pro_name_">
	                	<a href="${ctx}/product/view?id=<s:property value="#product.id"/>" target="_top" title="<s:property value="#product.prodName " />">
	                	<s:if test="#product.prodName.length() > 22">
	                		<s:property value="#product.prodName.substring(0,22) + '...' " />
	                	</s:if>
	                	<s:else>
	                		<s:property value="#product.prodName " />
	                	</s:else>	
	                	</a>
	                </div>
	                <div class="contact_"><s:property value="#product.contactName" /></div>
	                <div class="end_date_"><s:property value="#product.endDate" /></div>
	                <div class="public_date_"><s:property value="#product.createDate" /></div>
	                <div class="no_">
	                	<a href="${ctx}/my/updateProduct?productDTO.id=<s:property value="#product.id"/>" >修改</a>
	                    <a href="${ctx}/my/deleteProductById?productDTO.id=<s:property value="#product.id"/>" >删除</a>
	                </div>
	            </li>
            </s:iterator>
            <li align="center"><s:property value="%{productList.pagebar}"  escape="false"/></li>                      
        </div>         
    </div>
</body>
</html>
